<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateApplyTable extends Migration
{
    /**
     * 报名表单
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('apply', function (Blueprint $table) {
            $table->increments('id');
            $table->string('openid',50)->default('')->index();
            $table->tinyInteger('status')->default(0)->comment('状态：0未查看，1待定，2通过，3拒绝');
            $table->tinyInteger('stage')->default(1)->comment('阶段,1初审，2复审，...');
            $table->string('name')->default('')->index();
            $table->tinyInteger('sex')->default(1)->comment('1 for male, 2 for female');
            $table->string('province',50)->default('')->index();
            $table->string('city',50)->default('')->index();
            $table->string('school',50)->default('')->index();
            $table->string('zone')->default('')->comment('校区');
            $table->string('faculty')->default('')->comment('院系');
            $table->string('profession')->default('')->comment('专业');
            $table->tinyInteger('education')->default(4)->comment('学制');
            $table->tinyInteger('grade')->default(1)->comment('年级');
            $table->tinyInteger('degree')->default(2)->comment('学历，1研究生，2本科生，3专科生，4博士生');
            $table->string('phone')->default('')->comment('手机号');
            $table->string('wechat')->default('');
            $table->string('qq')->default('');
            $table->string('email')->default('');
            $table->string('photo')->default('')->comment('照片，绝对路径');
            $table->tinyInteger('apply')->default(0)->index()->comment('岗位类型');
            $table->string('applyDetail',1020)->default('')->comment('岗位详情');
            $table->string('organization',510)->default('')->comment('校内组织');
            $table->string('innerActivity',510)->default('')->comment('校内活动');
            $table->string('meizuOrg',510)->default('')->comment('魅族组织');
            $table->string('outerOrg',510)->default('')->comment('校外组织');
            $table->string('outerActivity',510)->default('')->comment('校外活动');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('apply');
    }
}
